package com.atguigu.gmall.list.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.list.service.GoodsSearchService;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.vo.GoodsSearchResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/9/7 1:22
 */
@RestController
@RequestMapping("/rpc/inner/list")
public class GoodsSearchResultController {
    @Autowired
    private GoodsSearchService goodsSearchService;
    @PostMapping("/search/result")
    public Result<GoodsSearchResultVo> searchResult(@RequestBody SearchParam searchParam){
        GoodsSearchResultVo goodsSearchResultVo = goodsSearchService.search(searchParam);
        return Result.ok(goodsSearchResultVo);
    }
}
